package org.bigjava.novelplatform.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Date;

/**
 * @author ykh
 * @create 2022-05-14 10:02
 */
@Data
public class ReleaseVo implements Serializable {
    //书籍id
    private Integer bookId;
    //用户id
    private Integer userId;
    //发布类型：1立刻，2定时
    private String releaseType;
    //发布周期：1延时，2每天
    private String releaseCycle;
    //发布时间
//    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
//    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalTimeDeserializer.class)
    @JsonSerialize(using = LocalTimeSerializer.class)
    @JsonFormat(pattern = "HH:mm",timezone = "GMT+8")
//    private Date releaseTime;
    private LocalTime releaseTime;
    //发布章节数
    private Integer chapterNumber;
}
